<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui@1.4.8/lib/theme-default/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui@1.4.8/lib/index.js"></script>
    <script src="script.js"></script>
  
</head>
<body>
    <div id="app">
        <template>
            <el-table
              :data="tableData"
              border
              style="width: 100%">
              <el-table-column
                fixed
                prop="name"
                label="图书名称"
                width="120">
                
              </el-table-column>
              <el-table-column
                prop="author"
                label="图书作者"
                width="110">
              </el-table-column>
              <el-table-column
                prop="kind"
                label="图书类别"
                width="110">
              </el-table-column>
              <el-table-column
                prop="press"
                label="图书出版社"
                width="120">
              </el-table-column>
              <el-table-column
                prop="sum"
                label="图书出版总数"
                width="130">
              </el-table-column>
              <el-table-column
                prop="zksum"
                label="当前还有几本"
                width="130">
              </el-table-column>
              <el-table-column
                prop="ISBN"
                label="图书唯一编码（全球图书唯一编码）"
                width="160">
              </el-table-column>
              <el-table-column
                prop="price"
                label="图书的价格"
                width="120">
              </el-table-column>
              <el-table-column
                prop="yhprice"
                label="图书的优惠价（一般是原价）"
                width="140">
              </el-table-column>
              <el-table-column
              prop="image"
              label="图书的图片链接"
              width="120">
            </el-table-column>
              <el-table-column
                fixed="right"
                label="操作"
                width="100">
                <template scope="scope">
                  <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
                  <el-button type="text" size="small">编辑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </template>
    </div>
    
      <script>
        var vm = new Vue({
            el:"#app",
           
          methods: {
            handleClick(row) {
              console.log(row);
            }
          },
      
          data() {
            return {
              tableData: [{
               
                name: '三国演义',
                author: '罗贯中',
                kind: '小说',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
              }, {
                date: '2016-05-02',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
              }, {
                date: '2016-05-04',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
              }, {
                date: '2016-05-01',
                name: '王小虎',
                province: '上海',
                city: '普陀区',
                address: '上海市普陀区金沙江路 1518 弄',
                zip: 200333
              }]
            }
          
        }

        })
        
      </script>
      <script>
        // var b = vm.$data.tableData[2]
        function renderHtml() {
          $.ajax({
            url:'http://192.168.96.109:8060/book/books',
            type:'get',
            data:{

            },
            success:(res)=>{
           console.log(res)
            } 
          })
        }
      </script>
</body>
</html>